package fox.framework.rpc.client.message.response;

/**
 * @author cuichao
 * @Description: ResponseEntity
 * @Date: create in 2021/1/23 15:30
 */
public abstract class ResponseEntity<T> {

    private T body;

    private int status;

    public ResponseEntity(T body, int status) {
        this.body = body;
        this.status = status;
    }

    /**
     * 得到消息体
     * @return
     */
    public T getBody(){
        return  body;
    }

    /**
     * 响应是否成功
     * @return
     */
    public boolean ok(){
        return 200 == status;
    }


    /**
     * 得到异常消息
     * @return
     */
    public abstract Exception getCause();




}
